<%--张爱文，查询票务并分页显示出来结果的页面 --%>
<%@page import="com.xz.group12306.business.service.impl.ManagerServiceImpl"%>
<%@page import="com.xz.group12306.business.service.ManagerService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="com.xz.group12306.domain.Ticket" %>
    <%@ page import="java.util.List" %>
     <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta charset="UTF-8">
    <title>Basic DataGrid - jQuery EasyUI Demo</title>
     <!-- <link rel="stylesheet" type="text/css" href="../js/util/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../js/util/easyui/themes/icon.css">

<script type="text/javascript" src="../js/util/jquery/jquery-3.2.1.min.js"></script> -->
<script type="text/javascript" src="../js/util/easyui/jquery.easyui.min.js"></script>
   
</head>
<body>
    
    
    <table class="easyui-datagrid" title="Basic DataGrid" style="width:700px;height:250px"
       >
  
     <thead>
     
            <tr>
                <th data-options="field:'Chance',width:80">选择</th>
                 <th data-options="field:'TicketID',width:100">车票ID</th>
                <th data-options="field:'depature',width:100">出发地</th>
                <th data-options="field:'destinction',width:80">目的地</th>
                <th data-options="field:'TrainNo',width:80">车次</th>
                <th data-options="field:'startTime',width:100">出发时间</th>

                 <th data-options="field:'CostTime',width:100">花费时间</th>
                  <th data-options="field:'TicketNo',width:60">余票数</th>
                  <th data-options="field:'choose',width:60">操作</th>
            </tr>
       </thead>   
       <%
       int pageSize = Integer.parseInt(request.getParameter("pageSize"));
		int start = Integer.parseInt(request.getParameter("start"));
		String depature = request.getParameter("depature");
		String destiction = request.getParameter("destiction");
		Ticket ticket = new Ticket();
		
		ticket.setDepature(depature);
		ticket.setDestinction(destiction);
		ManagerService managerService=new ManagerServiceImpl();
		List<Ticket> tickets = managerService.findTicketList(ticket, start, pageSize);
		request.setAttribute("tickets2", tickets);
       %>
             
            <%--  <%
               for(Ticket ticket2:tickets){
            	   
               
            %>  --%>
        <tbody>
        <c:forEach items="${ tickets2}" var="ticket">
            <tr>
            <td><input type="checkbox" name=""></td>
             <td>${ sessionScope.ticket.ticketId }</td>
               <td>${ticket.depature }</td>
                <td>${ticket.destinction }</td>
                 <td>${ticket.trainNo }</td>
                  <td>${ticket.startTime }</td>
                  <td>${ticket.costTime }</td>
                 <td>${ticket.ticketNo }</td>                  
                  
                    <td><a onclick="addTab('../ManageDelTicketServlet?TicketID=${ticket.ticketId}')">删除</a>&nbsp;&nbsp;
                      <a  onclick="addTab('../ManageUpdateTicketServlet?TicketID=${ticket.ticketId}')">修改</a>
                    </td>  
                   
            </tr>
            </c:forEach>
            </tbody>
            
            
             
           
   
    </table>
    
 
</body>
</html>